package cloud.demarcia.yzcrawler.utils;

import cloud.demarcia.yzcrawler.entities.Profile;
import cloud.demarcia.yzcrawler.entities.University;
import org.springframework.stereotype.Component;

@Component
public class UrlGenerator {


    public String getListUrl(University university) {
        return "https://yz.chsi.com.cn/zsml/querySchAction.do?ssdm=" + university.getProvinceCode() +
                "&dwmc=" + university.getUniversityName() + "&mldm=" + university.getProfile().getDegree() +
                "&mlmc=&yjxkdm=" + university.getProfile().getCode() + "&xxfs=&zymc=" + university.getProfile().getName();
    }

    public String getProvince(String code, Profile profile) {
        return "https://yz.chsi.com.cn/zsml/queryAction.do?ssdm=" + code +
                "&dwmc=&mldm=" + profile.getDegree() + "&mlmc=&yjxkdm=" + profile.getCode() + "&xxfs=&zymc=" + profile.getName();
    }

}
